

package com.hazelcast.internal.networking.nio;

import com.hazelcast.internal.networking.InboundHandler;
import com.hazelcast.internal.util.counters.Counter;

/**
 * Trigger for the ChannelReader to inject the appropriate counters. This is a
 * temporary solution, it would be best if the counters could be defined directly
 * on handlers and automatically get registered + unregistered.
 * <p>
 * Todo:
 * This class is a hack. We don't want to have any dependencies on this
 * packet.
 */
public abstract class InboundHandlerWithCounters<S, D> extends InboundHandler<S, D> {
    protected Counter normalPacketsRead;
    protected Counter priorityPacketsRead;

    public void setNormalPacketsRead(Counter normalPacketsRead) {
        this.normalPacketsRead = normalPacketsRead;
    }

    public void setPriorityPacketsRead(Counter priorityPacketsRead) {
        this.priorityPacketsRead = priorityPacketsRead;
    }
}
